package packing.testing;

import org.w3c.dom.ls.LSException;
import packing.coding.Student;

import java.util.*;
import java.util.Map.Entry;
class MyThread extends Thread{
    MyThread(String name){
        super(name);

    }
    public void run(){

        try {
            sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(getName()+"finished~");
    }


}
public class Test {

    public static void main(String[] args) throws InterruptedException {
        MyThread mt=new MyThread("a");
        MyThread mt2=new MyThread("b");

        mt.start();
        mt2.start();
        mt.join(1);


        mt2.join();


//        for(int i=1;i<=20;i++){
//            System.out.println("主线程运行第"+i+"次！");
//        }
//
//        System.out.println("主线程运行结束！");

    }

}
